package com.ruoyi.web.controller.four;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.four.FourPlatformService;
import com.ruoyi.region.domain.TSysArea;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 地区设置Controller
 * 
 * @author ruoyi
 * @date 2024-12-14
 */
@RestController
@RequestMapping("/four/platform")
public class FourPlatformController extends BaseController
{
    @Autowired
    private FourPlatformService fourPlatformService;

    /**
     * 查询运输公司--->车队
     */
    @GetMapping("/teamList")
    public AjaxResult teamList()
    {
        Map<String, Object> objectMap = new HashMap<>();
        LoginUser loginUser = getLoginUser();
        String sessionId = loginUser.getSessionId();
        objectMap.put("sessionId",sessionId);
        List list = fourPlatformService.teamList(objectMap);
        return AjaxResult.success(list);
    }

    /**
     * 查询运输公司--->车队
     */
    @PostMapping("/teamDetails")
    public AjaxResult teamList(@RequestBody Map<String, Object> objectMap)
    {
        LoginUser loginUser = getLoginUser();
        String sessionId = loginUser.getSessionId();
        objectMap.put("sessionId",sessionId);
        List list = fourPlatformService.teamList(objectMap);
        return AjaxResult.success(list);
    }


    /**
     * 查询车辆信息
     */
    @PostMapping("/getCarList")
    public AjaxResult getCarList(@RequestBody Map<String, Object> objectMap)
    {
        LoginUser loginUser = getLoginUser();
        String sessionId = loginUser.getSessionId();
        objectMap.put("sessionId",sessionId);
        List list = fourPlatformService.getCarList(objectMap);
        return AjaxResult.success(list);
    }

    /**
     * 车辆轨迹
     */
    @PostMapping("/getGpsPlate")
    public AjaxResult getGpsPlate(@RequestBody Map<String, Object> objectMap)
    {
        LoginUser loginUser = getLoginUser();
        String sessionId = loginUser.getSessionId();
        objectMap.put("sessionId",sessionId);
        List list = fourPlatformService.getGpsPlate(objectMap);
        return AjaxResult.success(list);
    }

    /**
     * 查询账号下车辆定位
     */
    @PostMapping("/getGpsR")
    public AjaxResult getGpsR(@RequestBody Map<String, Object> objectMap)
    {
        LoginUser loginUser = getLoginUser();
        String sessionId = loginUser.getSessionId();
        objectMap.put("sessionId",sessionId);
        List list = fourPlatformService.getGpsR(objectMap);
        return AjaxResult.success(list);
    }

    /**
     * 查询标注工地、消纳场
     */
    @PostMapping("/getPois")
    public AjaxResult getPois(@RequestBody Map<String, Object> objectMap)
    {
        LoginUser loginUser = getLoginUser();
        String sessionId = loginUser.getSessionId();
        objectMap.put("sessionId",sessionId);
        List list = fourPlatformService.getPois(objectMap);
        return AjaxResult.success(list);
    }


}
